package oops;

public class InterfaceDemo {

	
	public void display(Object object){
		
		 
		if(object instanceof HelloWorld){
			HelloWorld world = (HelloWorld) object;
			world.sayHello();
		}
		
	}
	public static void main(String[] args) {
		
		HelloWorld world = new HelloWorldImpl();
		world.sayHello();
		
		MyWorld myWorld = new HelloWorldImpl();
		myWorld.wishAsPerTime();
		
		HelloWorld world1 = (HelloWorld) myWorld;
		world1.sayHello();
		
		InterfaceDemo demo = new InterfaceDemo();
		demo.display(world);
		
		

	}

}
